<template>
  <div class="storeInfo">
    <!-- 店铺信息 -->
    <div class="oneCell pd">
      <div class="cf tit">
        <div class="fl">店铺信息</div>
        <div class="fr">
          <a :href="'#/editStore/' + $route.params.id" class="el-button el-button--primary">编辑</a>
        </div>
      </div>
      <div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%;">
        <div class="el-table__header-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 100%;">
            <thead>
              <tr>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">店铺名称</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">店铺类型</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">销售渠道</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">品牌</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">店铺客服电话</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">品类</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">是否自营</div></th>
              </tr>
            </thead>
          </table>
        </div>
        <div class="el-table__body-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;">
            <tbody>
              <tr class="el-table__row">
                <td><div class="cell">{{storeName}}</div></td>
                <td><div class="cell">{{storeBusinessType}}</div></td>
                <td><div class="cell">{{storeType}}</div></td>
                <td><div class="cell">{{storeBannerId}}</div></td>
                <td><div class="cell">{{storeTelephone}}</div></td>
                <td><div class="cell">{{categorySysno}}</div></td>
                <td><div class="cell">{{selfSupport}}</div></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <!-- 店铺配置 -->
    <div class="oneCell pd">
      <div class="cf tit">
        <div class="fl">店铺配置</div>
        <div class="fr">
          <a :href="'#/storeConfigure/' + $route.params.id" class="el-button el-button--primary">编辑</a>
        </div>
      </div>
      <div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%;">
        <div class="el-table__header-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 100%;">
            <thead>
              <tr>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">是否配送</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">金币锁定周期</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">售后退换周期（不包含7天无条件）</div></th>
              </tr>
            </thead>
          </table>
        </div>
        <div class="el-table__body-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;">
            <tbody>
              <tr class="el-table__row">
                <td><div class="cell">{{isDistribution}}</div></td>
                <td><div class="cell">{{toCoinDay}}</div></td>
                <td><div class="cell">{{returnGoodsDay}}</div></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <!-- 合同信息 -->
    <div class="oneCell pd">
      <div class="cf tit">
        <div class="fl">合同信息</div>
      </div>
      <div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%;">
        <div class="el-table__header-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 100%;">
            <thead>
              <tr>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">合同名称</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">合同编号</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">管理费类型</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">管理费</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">返利方式</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">返佣比例</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell"></div></th>
              </tr>
            </thead>
          </table>
        </div>
        <div class="el-table__body-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;">
            <tbody>
              <tr class="el-table__row">
                <td><div class="cell">{{contractName}}</div></td>
                <td><div class="cell">{{contractNo}}</div></td>
                <td><div class="cell">{{manageRebatesType}}</div></td>
                <td><div class="cell">{{manageRebatesRate}}</div></td>
                <td><div class="cell">{{coinRebatesType}}</div></td>
                <td><div class="cell">{{coinRebatesRate}}</div></td>
                <td><div class="cell"><a :href="'#/editContract/' + $route.params.id" class="el-button el-button--primary">变更</a></div></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <!-- 售后信息 -->
    <div class="oneCell pd">
      <div class="cf tit">
        <div class="fl">售后信息</div>
        <div class="fr">
          <a :href="'#/editSaleInfo/' + $route.params.id" class="el-button el-button--primary">编辑</a>
        </div>
      </div>
      <div class="el-table el-table--fit el-table--enable-row-hover el-table--enable-row-transition" style="width: 100%;">
        <div class="el-table__header-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__header" style="width: 100%;">
            <thead>
              <tr>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">售后联系人</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">售后电话</div></th>
                <th colspan="1" rowspan="1" class="is-leaf"><div class="cell">售后地址</div></th>
              </tr>
            </thead>
          </table>
        </div>
        <div class="el-table__body-wrapper">
          <table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 100%;">
            <tbody>
              <tr class="el-table__row">
                <td><div class="cell">{{afterSaleName}}</div></td>
                <td><div class="cell">{{afterSalePhone}}</div></td>
                <td><div class="cell">{{afterSaleAddress}}</div></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    data () {
      return {
        datails: {},
        storeName: '',
        storeBusinessType: '',
        storeType: '',
        storeBannerId: '',
        storeTelephone: '',
        categorySysno: '',
        selfSupport: '',
        isDistribution: '',
        toCoinDay: '',
        returnGoodsDay: '',
        contractName: '',
        contractNo: '',
        manageRebatesType: '',
        manageRebatesRate: '',
        coinRebatesType: '',
        coinRebatesRate: '',
        afterSaleName: '',
        afterSalePhone: '',
        afterSaleAddress: ''
      }
    },
    methods: {
    },
    mounted () {
      axios.post('/api/shop/queryShopDetail', {storeSysno: this.$route.params.id}).then((res) => {
        if (res.data.code === 9999) {
          this.details = res.data.data
          this.storeName = this.details.storeName
          if (this.details.storeBusinessType === 10) {
            this.storeBusinessType = '奢品'
          } else {
            this.storeBusinessType = '餐饮'
          }
          if (this.details.storeType === 0) {
            this.storeType = '线下'
          } else {
            this.storeType = '线上'
          }
          this.storeBannerId = this.details.storeBannerId
          this.storeTelephone = this.details.storeTelephone
          this.categorySysno = this.details.categorySysno
          if (this.details.selfSupport === 0) {
            this.selfSupport = '自营'
          } else {
            this.selfSupport = '非自营'
          }
          if (this.details.isDistribution === 0) {
            this.isDistribution = '是'
          } else {
            this.isDistribution = '否'
          }
          this.toCoinDay = this.details.toCoinDay
          this.returnGoodsDay = this.details.returnGoodsDay
          this.contractName = this.details.contractName
          this.contractNo = this.details.contractNo
          if (this.details.manageRebatesType === 0) {
            this.manageRebatesType === '按年'
          } else {
            this.manageRebatesType = '按比例'
          }
          this.manageRebatesRate = this.details.manageRebatesRate
          if (this.details.coinRebatesType === 0) {
            this.coinRebatesType = '定额'
          } else if (this.details.coinRebatesType === 1) {
            this.coinRebatesType = '按比例'
          } else {
            this.coinRebatesType = '不设置返利'
          }
          this.coinRebatesRate = this.details.coinRebatesRate
          this.afterSaleName = this.details.afterSaleName
          this.afterSalePhone = this.details.afterSalePhone
          this.afterSaleAddress = this.details.afterSaleAddress
        }
      })
    }
  }

</script>

<style lang="less" rel="stylesheet/less" scoped>
  .oneCell .tit{
    height: 44px;
  }
</style>
